package me.zhengjie.pm.projectbase.service;

import me.zhengjie.pm.projectbase.domain.ProjectBase;
import me.zhengjie.pm.projectbase.service.dto.ProjectBaseDto;
import me.zhengjie.pm.projectbase.service.dto.ProjectBaseQueryCriteria;
import org.springframework.data.domain.Pageable;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
* @author ZGZ
* @date 2020-04-14
*/
public interface ProjectBaseService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(ProjectBaseQueryCriteria criteria, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<ProjectBaseDto>
    */
    List<ProjectBaseDto> queryAll(ProjectBaseQueryCriteria criteria);

    /**
     * 根据ID查询
     * @param id ID
     * @return ProjectBaseDto
     */
    ProjectBaseDto findById(Integer id);

    /**
    * 创建
    * @param resources /
    * @return ProjectBaseDto
    */
    ProjectBaseDto create(ProjectBase resources);

    /**
    * 编辑
    * @param resources /
    */
    void update(ProjectBase resources);

    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(Integer[] ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<ProjectBaseDto> all, HttpServletResponse response) throws IOException;

    void compareAndSaveChange(ProjectBase oldInfo,ProjectBase nowInfo);
}